<?php

$page = "index";
if (array_key_exists("page", $_POST)) $page = $_POST["page"];
if (array_key_exists("page", $_GET))  $page = $_GET["page"];

include_once("root.php");
include_once($ROOT . "control/$page" . "Controller.php");

$PHP_SELF = $_SERVER['PHP_SELF'] . "?page=" . $page;

$c = & new PageController();
?>

<html>
	<head>
		<title><?php echo $c->title; ?></title>
		<link rel="stylesheet" type="text/css" href="css/print.css" />
	</head>

	<body>
	  <?php echo displayErrors($c->errs); ?>
	  <?php echo displayMessages($c->messages); ?>

	  <?php include_once("pages/$page.php"); ?>
	</body>
</html>